package pub.wkq.file.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * <h1></h1>
 */
@Configuration
public class StaticResourceConfig extends WebMvcConfigurationSupport {
    /**
     * 添加静态资源映射的路径，css/js/html等文件都可以
     * addResourceHandler 指的是对外暴露的访问路径
     * addResourceLocations 指的是内部文件放置的目录
     * @param registry
     */
    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**") //访问路径
                .addResourceLocations("C:\\Users\\21129\\Downloads\\temp\\"); // 文件存放路径
        super.addResourceHandlers(registry);
    }
}
